package com.dingwen.treasure.business.controller;

import com.dingwen.treasure.base.controller.BaseViewController;
import com.dingwen.treasure.base.pojo.vo.Result;
import com.dingwen.treasure.business.feign.TreasureTaskFeignClient;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 测试 feign 调用: business --> task
 *
 * @author dingwen
 * @date 2022/05/03
 */
@Api(tags = "feign调用: business --> task")
@RestController
@RequestMapping("feign/task")
public class TaskFeignController implements BaseViewController {

    /**
     * feign task
     */
    @Resource
    private  TreasureTaskFeignClient treasureTaskFeignClient;

    @GetMapping()
    @ApiOperationSupport(author = "dingwen")
    @ApiOperation("feign: business --> task")
    @ApiImplicitParam(name = "id", value = "编号", type = "Long")
    public Result<Long> feignTest(@RequestParam Long id) {
        return treasureTaskFeignClient.test(id);
    }
}
